

#ifndef _TfCamera_
#define _TfCamera_



#include "../TF_Geom/tf_Common.h"


#define	VIEW_FRONT		0
#define	VIEW_BACK		1
#define VIEW_TOP		2
#define	VIEW_BOTTOM		3
#define VIEW_RIGHT		4
#define	VIEW_LEFT		5
#define VIEW_SW_ISOMETRIC	6
#define VIEW_SE_ISOMETRIC	7
#define VIEW_NE_ISOMETRIC	8
#define VIEW_NW_ISOMETRIC	9

#define ZOOM_ALL		9
#define ZOOM_IN			10
#define ZOOM_OUT		11

class dllDeclspec TfCamera
{
	
protected:
	//eye coordinator
    double	m_eye[3];
	double	m_ref[3];
	double	m_vecUp[3];
	
	//viewing volume
    double		m_far, m_near;
	double	 	m_width,m_height;
	
	//viewport
	double			m_screen[2];
	
public:
    TfCamera();
	~TfCamera();
	
	//initailizing
	void Init();
    void Projection();
	void Selection(int xPos,int yPos);
	
	//zooming
    void Zoom(double scale); 
	void ZoomAll(double x0,double y0,double z0,double x1,double y1,double z1);
	
	//switch into a classical view
    void SetViewType(int type);
	
	//move view with precent
	void MoveView(double dpx, double dpy);
	
	//set viewport acoording to window
	void SetScreen( int x, int y);
	
	//set eye coordinate
	void SetEye(double eye_x,double eye_y,double eye_z);
	void SetRef(double ref_x,double ref_y,double ref_z);
	void SetVecUp(double up_dx,double up_dy,double up_dz);
	
	//set viewing volume
	void SetViewRect(double width,double height);
	void GetViewRect(double& width,double& height);
	
protected:
    void UpdateUpVec();
};
#endif 